<!DOCTYPE html>
<html lang="en" xmlns:th="http://www.thymeleaf.org">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
</head>
<body>
<div th:fragment="header">
    <header>
        <div class="top_bar">
            <div class="container">
                <div class="top_header_content">
                    <!-- 头部左侧菜单和图标 -->
                    <div class="menu_logo">
                        <a href="/user/userHomePage" title="D站" class="logo">
                            <img th:src="@{/pagesResource/img/logo.png}" alt="">
                        </a>
                    </div>
                    <!--右边按钮组-->
                    <ul class="controls-lv">
                        <th:block th:unless="${session.userInfo==null}">
                            <li>
                                <span class="iconfont icon-shoucang1"></span>
                                <a th:href="@{/dynamic/homePage}">动态</a>
                            </li>
                        </th:block>
                        <li class="user-log">
                            <div class="user-ac-img">
                                <th:block th:if="${session.userInfo==null}">
                                    <img th:src="@{/pagesResource/img/unlogin.jpg}" alt="用户头像">
                                </th:block>
                                <th:block th:unless="${session.userInfo==null}">
                                    <a th:href="@{/user/userMainPage}+ '?userId='+${session.userInfo.userId}">
                                        <img th:src="@{/images/userIcon/{userIc}(userIc=${session.userInfo.userIcon})}"
                                             style="width: 57px; height: 60px" alt="用户头像">
                                    </a>
                                </th:block>
                            </div>
                            <th:block th:unless="${session.userInfo==null}">
                                <div class="menu-down">
                                    <span class="glyphicon glyphicon-menu-down"></span>
                                </div>
                            </th:block>
                            <!-- 用户功能栏 -->
                            <div class="account-menu">
                                <div class="top_menu">
                                    <div>
                                        <h4 th:if="${session.userInfo}!=null"
                                            th:utext="${session.userInfo.userName}"><span
                                                class="usr-status">在线</span></h4>
                                    </div>
                                    <div class="balance">
                                        <a th:if="${session.userInfo}!=null" th:href="@{/coin/rechargeCoinPage}"
                                           title="硬币数">硬币数: <span>[[${session.userInfo.userBalance}]]</span></a>
                                        <a th:if="${session.userInfo}!=null" th:href="@{/subscriptionPackage/rechargeWatchTimePage}"
                                           title="可观看数">可观看数:<span>[[${session.userInfo.privilegetimes}]]</span></a>
                                    </div>
                                </div>

                                <div class="sd_menu">
                                    <ul class="mm_menu">
                                        <li>
                                            <span>
                                                <i class="iconfont icon-shipin"></i>
                                            </span>
                                            <a th:href="@{/video/myVideoPage?page=1}" title="我的视频">我的视频</a>
                                        </li>
                                        <li>
                                            <span>
												<i class="iconfont icon-dingdan"></i>
											</span>
                                            <a th:href="@{/order/myOrder?page=1}" title="我的订单">我的订单</a>
                                        </li>
                                        <li>
                                            <span>
                                                <i class="iconfont icon-shoucang1"></i>
                                            </span>
                                            <a th:href="@{/collect/viewCollect?page=1}" title="我的收藏">我的收藏</a>
                                        </li>
                                        <li>
                                            <span>
                                                <i class="iconfont icon-xiaoxizhongxin"></i>
                                            </span>
                                            <a th:href="@{/message/viewMessage?page=1}" title="我的消息">我的消息</a>
                                        </li>
                                        <li>
                                            <span>
                                                <i class="iconfont icon-fenxi"></i>
                                            </span>
                                            <a th:href="@{/analysis/analysisPage}" title="视频分析">视频分析</a>
                                        </li>
                                        <li>
                                            <span>
                                                <i class="iconfont icon-gerenshezhi"></i>
                                            </span>
                                            <a th:href="@{/user/userAccountPage}" title="个人设置">个人设置</a>
                                        </li>
                                        <li>
                                            <span>
                                                <i class="iconfont icon-zhuxiaodenglu"></i>
                                            </span>
                                            <a th:href="@{/user/logout}" title="退出登录">退出登录</a>
                                        </li>
                                    </ul>
                                </div>
                            </div>
                        </li>
                        <li>
                            <th:block th:unless="${session.userInfo==null}">
                                <a href="/video/uploadVideoPage" title="上传视频" class="btn-default">上传</a>
                            </th:block>
                            <th:block th:if="${session.userInfo==null}">
                                <a href="/user/userLoginPage" title="登录/注册" class="btn-default">登录/注册</a>
                            </th:block>
                        </li>
                        <th:block th:unless="${session.userInfo==null}">
                            <li>
                                <span>
                                    <i class="iconfont icon-guanzhu"></i>
                                </span>
                                <a th:href="@{/followTable/myFollowListPage}" title="我的关注">我的关注</a>
                            </li>
                        </th:block>
                    </ul>
                </div>
            </div>
        </div>
    </header>
</div>

</body>
</html>